Optimal. Leaf size=76 \[ \frac {2 (a c-b d) \text {ArcTan}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a+b}}\right )}{a \sqrt {a-b} \sqrt {a+b} f}+\frac {d \tanh ^{-1}(\sin (e+f x))}{a f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 76, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {2907, 3080,
3855, 2738, 211} \begin {gather*} \frac {2 (a c-b d) \text {ArcTan}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a+b}}\right )}{a f \sqrt {a-b} \sqrt {a+b}}+\frac {d \tanh ^{-1}(\sin (e+f x))}{a f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 2738
Rule 2907
Rule 3080
Rule 3855
Rubi steps
\begin {align*} \int \frac {c+d \sec (e+f x)}{a+b \cos (e+f x)} \, dx &=\int \frac {(d+c \cos (e+f x)) \sec (e+f x)}{a+b \cos (e+f x)} \, dx\\ &=\frac {d \int \sec (e+f x) \, dx}{a}+\frac {(a c-b d) \int \frac {1}{a+b \cos (e+f x)} \, dx}{a}\\ &=\frac {d \tanh ^{-1}(\sin (e+f x))}{a f}+\frac {(2 (a c-b d)) \text {Subst}\left (\int \frac {1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{a f}\\ &=\frac {2 (a c-b d) \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a+b}}\right )}{a \sqrt {a-b} \sqrt {a+b} f}+\frac {d \tanh ^{-1}(\sin (e+f x))}{a f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.17, size = 112, normalized size = 1.47 \begin {gather*} \frac {\frac {(-2 a c+2 b d) \tanh ^{-1}\left (\frac {(a-b) \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {-a^2+b^2}}\right )}{\sqrt {-a^2+b^2}}+d \left (-\log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )+\log \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )\right )}{a f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.28, size = 92, normalized size = 1.21
method | result | size |
derivativedivides | \(\frac {\frac {2 \left (a c -b d \right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{a \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {d \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{a}+\frac {d \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{a}}{f}\) | \(92\) |
default | \(\frac {\frac {2 \left (a c -b d \right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{a \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {d \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{a}+\frac {d \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{a}}{f}\) | \(92\) |
risch | \(-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a^{2}-i b^{2}+a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) c}{\sqrt {-a^{2}+b^{2}}\, f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a^{2}-i b^{2}+a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) b d}{\sqrt {-a^{2}+b^{2}}\, f a}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {-i a^{2}+i b^{2}+a \sqrt {-a^{2}+b^{2}}}{\sqrt {-a^{2}+b^{2}}\, b}\right ) c}{\sqrt {-a^{2}+b^{2}}\, f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {-i a^{2}+i b^{2}+a \sqrt {-a^{2}+b^{2}}}{\sqrt {-a^{2}+b^{2}}\, b}\right ) b d}{\sqrt {-a^{2}+b^{2}}\, f a}+\frac {d \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{a f}-\frac {d \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{a f}\) | \(327\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.69, size = 308, normalized size = 4.05 \begin {gather*} \left [\frac {{\left (a^{2} - b^{2}\right )} d \log \left (\sin \left (f x + e\right ) + 1\right ) - {\left (a^{2} - b^{2}\right )} d \log \left (-\sin \left (f x + e\right ) + 1\right ) + \sqrt {-a^{2} + b^{2}} {\left (a c - b d\right )} \log \left (\frac {2 \, a b \cos \left (f x + e\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (f x + e\right ) + b\right )} \sin \left (f x + e\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (f x + e\right )^{2} + 2 \, a b \cos \left (f x + e\right ) + a^{2}}\right )}{2 \, {\left (a^{3} - a b^{2}\right )} f}, \frac {{\left (a^{2} - b^{2}\right )} d \log \left (\sin \left (f x + e\right ) + 1\right ) - {\left (a^{2} - b^{2}\right )} d \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, \sqrt {a^{2} - b^{2}} {\left (a c - b d\right )} \arctan \left (-\frac {a \cos \left (f x + e\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (f x + e\right )}\right )}{2 \, {\left (a^{3} - a b^{2}\right )} f}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {c + d \sec {\left (e + f x \right )}}{a + b \cos {\left (e + f x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.50, size = 133, normalized size = 1.75 \begin {gather*} \frac {\frac {d \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right )}{a} - \frac {d \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right )}{a} - \frac {2 \, {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )} {\left (a c - b d\right )}}{\sqrt {a^{2} - b^{2}} a}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.55, size = 345, normalized size = 4.54 \begin {gather*} \frac {2\,d\,\mathrm {atanh}\left (\frac {\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )}{a\,f}-\frac {b\,\left (d\,\ln \left (\frac {a\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+b\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )-\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {b^2-a^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {-\left (a+b\right )\,\left (a-b\right )}-d\,\ln \left (\frac {b\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )-a\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )+\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {b^2-a^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {b^2-a^2}\right )+a\,c\,\ln \left (\frac {b\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )-a\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )+\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {b^2-a^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {b^2-a^2}-a\,c\,\ln \left (\frac {a\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+b\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )-\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {b^2-a^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {-\left (a+b\right )\,\left (a-b\right )}}{a\,f\,\left (a^2-b^2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________